/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package longprojectihm;

import java.awt.BorderLayout;
import java.awt.Color;
import javax.swing.JFrame;
import javax.swing.JScrollPane;
import javax.swing.JTable;

/**
 *
 * @author haythem
 */
public class Test extends JFrame {
    public enum Sport {
    TENNIS,
    FOOTBALL,
    NATATION,
    RIEN;
}
    public Test() {
        super();

        setTitle("JTable basique dans un JScrollPane");
        setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

        Object[][] donnees = {
                {"Johnathan", "Sykes", Color.red, true, Sport.TENNIS},
                {"Nicolas", "Van de Kampf", Color.black, true, Sport.FOOTBALL},
        };

        String[] entetes = {"Prénom", "Nom", "Couleur favorite", "Homme", "Sport"};

        JTable tableau = new JTable(donnees, entetes);

        getContentPane().add(new JScrollPane(tableau), BorderLayout.CENTER);

        pack();
        System.out.println(donnees.length);
    }

    public static void main(String[] args) {
        new Test().setVisible(true);
    }
}
